﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Admin.Master" AutoEventWireup="true" CodeBehind="InitPayPeriod.aspx.cs" Inherits="Legazpi.Payroll.Web.Admin.Payroll.InitPayPeriod" %>

<asp:Content ID="Content3" ContentPlaceHolderID="leftContent" runat="server">
    <div class="grid_9">                                    
        <%if(IsSuccess) {%>
            <span class="notification n-success"><%=NotifyText %></span>                                                
        <%}
          else if (!IsValidSave && !string.IsNullOrEmpty(NotifyText))
          {%>           
            <span class="notification n-error"><%=NotifyText %></span>                                                
        <%} %>
        <h4>Current Active Payroll Period: <span style="color: #FF0000"><asp:Literal runat="server" ID="CurrentActivePayrollLiteral"></asp:Literal></span></h4>                        
        <h4>Previous Payroll Period: <span style="color: #FF0000"><asp:Literal runat="server" ID="PreviousPayrollLiteral"></asp:Literal></span></h4>
    </div>   
    <div class="grid_3">                
        <div class="module">
                <h2><span>New Record Entry</span></h2>
                        
                <div class="module-body">
                        
                    <p>
                        <label>Start Paydate:</label>
                        <asp:HiddenField ID="PaydateId" runat="server" Value="0" />
                        <asp:DropDownList ID="MonthDroplistStart" runat="server" CssClass="input-short">
                        </asp:DropDownList>
                        <asp:DropDownList ID="DayDroplistStart" runat="server" CssClass="input-short">
                            <asp:ListItem Value="01">01</asp:ListItem>
                            <asp:ListItem Value="16">16</asp:ListItem>
                        </asp:DropDownList>
                        <asp:DropDownList ID="YearDroplistStart" runat="server" CssClass="input-short">
                        </asp:DropDownList>
                    </p>
                    <p>
                        <label>End Paydate:</label>
                        <asp:DropDownList ID="MonthDroplistEnd" runat="server" CssClass="input-short">
                        </asp:DropDownList>
                        <asp:DropDownList ID="DayDroplistEnd" runat="server" CssClass="input-short">
                            <asp:ListItem Value="15">15</asp:ListItem>
                            <asp:ListItem Value="27">27</asp:ListItem>
                            <asp:ListItem Value="28">28</asp:ListItem>
                            <asp:ListItem Value="29">29</asp:ListItem>
                            <asp:ListItem Value="30">30</asp:ListItem>
                            <asp:ListItem Value="31">31</asp:ListItem>
                        </asp:DropDownList>
                        <asp:DropDownList ID="YearDroplistEnd" runat="server" CssClass="input-short">
                        </asp:DropDownList>
                    </p>
                    <fieldset>                                
                        <ul>
                            <li>
                                <label>                                                                        
                                    <asp:CheckBox runat="server" ID="SetActiveChckbox"/>
                                    Set Active
                                </label>
                            </li>                                    
                        </ul>
                    </fieldset>
                    <fieldset>
                        <asp:Button id="SubmitBtn" runat="server" Text="Submit" CssClass="submit-green" 
                            onclick="SubmitBtn_Click" />                                                                                                                                        
                        <asp:Button id="CancelBtn" runat="server" Text="Cancel" CssClass="submit-gray" 
                            onclick="CancelBtn_Click" />
                    </fieldset>
                        
                        
                </div> <!-- End .module-body -->
        </div> <!-- End .module -->
        <div style="clear:both;"></div>
    </div>
    <div class="grid_5">      
   
            <div class="module">
                    <h2><span>Paydates Table</span></h2>
                     
                    <div class="module-body">                                                         
                    <asp:Repeater ID="repeater" runat="server" OnItemCommand="repeater_ItemCommand" 
                            onitemdatabound="repeater_ItemDataBound">
                    <HeaderTemplate>
                        <table width="100%" border="0" class="tablesorter">
                            <thead>                                        
                                <th>Id</th>
                                <th>Start Paydate</th>
                                <th>End Paydate</th>
                                <th>Status</th>
                                <th width="15%"></th>
                            </thead>
                            <tbody>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr class="odd">                                    
                            <td><%# Eval("Id")%></td>                                        
                            <td><asp:Literal ID="StartDateLiteral" runat="server"></asp:Literal></td>
                            <td><asp:Literal ID="EndDateLiteral" runat="server"></asp:Literal></td>
                            <td><asp:Literal ID="ActiveLiteral" runat="server"></asp:Literal></td>
                            <td>                                                                    
                                <asp:ImageButton ID="SetActiveBtn" runat="server" ImageUrl="~/images/tick-circle.gif" Width="16" Height="16" AlternateText="active" CommandName="save" CommandArgument=<%# Eval("Id")%> />
                                <asp:ImageButton ID="SaveLinkBtn" runat="server" ImageUrl="~/images/pencil.gif" Width="16" Height="16" AlternateText="save" CommandName="update" CommandArgument=<%# Eval("Id")%> />
                                <asp:ImageButton ID="DeleteLinkBtn" runat="server" ImageUrl="~/images/bin.gif" Width="16" Height="16" AlternateText="delete" CommandName="delete"  CommandArgument=<%# Eval("Id")%> OnClientClick="return confirm('Confirm Delete?');" />                                        
                            </td>
                        </tr>                            
                    </ItemTemplate>
                    <AlternatingItemTemplate>
                        <tr class="even">                                    
                            <td><%# Eval("Id")%></td>                                        
                            <td><asp:Literal ID="StartDateLiteral" runat="server"></asp:Literal></td>
                            <td><asp:Literal ID="EndDateLiteral" runat="server"></asp:Literal></td>
                            <td><asp:Literal ID="ActiveLiteral" runat="server"></asp:Literal></td>
                            <td>                                        
                                <asp:ImageButton ID="SetActiveBtn" runat="server" ImageUrl="~/images/tick-circle.gif" Width="16" Height="16" AlternateText="active" CommandName="save" CommandArgument=<%# Eval("Id")%> />
                                <asp:ImageButton ID="SaveLinkBtn" runat="server" ImageUrl="~/images/pencil.gif" Width="16" Height="16" AlternateText="save" CommandName="update" CommandArgument=<%# Eval("Id")%> />
                                <asp:ImageButton ID="DeleteLinkBtn" runat="server" ImageUrl="~/images/bin.gif" Width="16" Height="16" AlternateText="delete" CommandName="delete"  CommandArgument=<%# Eval("Id")%> OnClientClick="return confirm('Confirm Delete?');" />                                        
                            </td>
                        </tr>                            
                    </AlternatingItemTemplate>
                    <FooterTemplate>
                            </tbody>
                        </table>
                    </FooterTemplate>
                    </asp:Repeater>                            
                                                   
                    </div> <!-- End .module-body -->

            </div>  <!-- End .module -->        		   
                                                            
    </div>
</asp:Content>